package com.common.retrofit.method;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.DuoBaoService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class ShaiDanMethods extends BaseMethods {

    private static ShaiDanMethods m_ins = null;

    public static ShaiDanMethods getInstance() {
        if (m_ins == null) {
            synchronized (ShaiDanMethods.class) {
                if (m_ins == null) {
                    m_ins = new ShaiDanMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/MemberPost/";
    }

    private DuoBaoService initService() {
        return getRetrofit().create(DuoBaoService.class);
    }


    public void     addSaidan          (Subscriber<Object> subscriber,
                      int uid
            ,String hashid
            ,String title
            ,String goodname
            ,String fvid
            ,String content
            ,String imgid
            ,int fabutype
    ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().addSaidan(time,SortUtils.getMyHash("uid"+uid,"hashid"+hashid ,"time"+time
                ,"title"+title
                ,"goodname"+goodname
                ,"fvid"+fvid
                ,"content"+content
                ,"imgid"+imgid
                ,"fabutype"+fabutype
        ),Constans.ANDROID_APP_ID,"3",uid,hashid,title,goodname,fvid,content,imgid,fabutype);
        toSubscribe(observable, subscriber);
    }
}
